/*******************************************************
> Copyright (C) 2024 ==IOT== All rights reserved.
> File Name: stl_merge.cpp
> Author: IOT
> Website:www.slq.org
> Created Time: 2024年10月31日 星期四 11时13分03秒
***************************************************/

#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <memory>

using namespace std;
struct Print {
	void operator()(int x) 
	{
		cout << x << endl;
	}
}printx;

struct Node {
	int val;
	Node *next;
};

int main(int argc,const char* argv[])
{
	int arr1[3] = {1,3,5};
	int arr2[3] = {2,4,6};

	vector<int> vec(6);
	cout << vec.size() << endl;
	for (auto& x:vec) {
		cout << x << endl;
	}

	merge(arr1, arr1+3, arr2, arr2 + 3, vec.begin());
	cout << endl;	
	for_each(vec.begin(), vec.end(), printx);
	
	Node *head = nullptr;
	
	for (auto& x:vec) {
		Node *p = new Node;
		p->val = x;
		
		add_node(&head, p);
	}
	
    return 0;
}

